<template>
    <div>
        <Table :columns="col" :data="list" style="margin-top: 15px;"></Table>
        <div style="display: flex;justify-content: center;margin: 15px 0">
            <Page :total=total :page-size="pageSize" :current="pageIndex" show-total show-elevator @on-change="changePage"/>
        </div>
    </div>
</template>
<script>
    import {modifyRecord} from '@/api/train.js'
    export default {
        data () {
            return {
                scenarioId:this.$route.query.id,
                col:[
                    {
                        type: 'index',
                        width: 60,
                        align:'center'
                    },
                    {
                        title:'操作人',
                        key:'creatorName',
                        align:'center'
                    },
                    {
                        title:'被修改学员',
                        key:'userName',
                        align:'center'
                    },
                    {
                        title:'训练任务名称',
                        key:'taskName',
                        align:'center'
                    },
                    {
                        title:'原分值',
                        key:'oldScore',
                        align:'center'
                    },
                    {
                        title:'修改后分值',
                        key:'finalScore',
                        align:'center'
                    },
                    {
                        title:'评语',
                        key:'content',
                        align:'center'
                    },
                    {
                        title:'修改时间',
                        key:'createTime',
                        align:'center'
                    },
                ],
                list:[],
                pageSize:10,
                pageIndex:1,
                total:0,
            }
        },
        created(){
            
        },
        mounted(){
            this.getList()
        },
        methods:{
            getList(){
                let params = {
                    trainingId:this.scenarioId,
                    pageIndex:this.pageIndex,
                    pageSize:this.pageSize,
                }
                modifyRecord(params)
                .then(res=>{
                    if(res.data.code === 1){
                        this.list = res.data.data.records
                        this.total = res.data.data.total
                    }
                })
                .catch(err=>{
                    console.log(err)
                })
            },
            changePage(val){
                this.pageIndex = val
                this.getList()
            },
        }
    }
</script>
<style scoped>
    
</style>

